package com.ccsoft.zknote.pojo.system;

/**
 * @ClassName:BusinessException
 * @Description:TODO
 * @Author:chanchaw
 * @Date:2019-12-24 8:12
 * @Version:1.0
 **/
public class BusinessException extends RuntimeException {
    private String code;
    private String msg;

    public BusinessException() {
    }

    public BusinessException(String msg) {
        this.code = ResultCode.UNDEFINED_ERROR.getCode();
        this.msg = msg;
    }

    public BusinessException(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(ResultCode rc) {
        this.code = rc.getCode();
        this.msg = rc.getMsg();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "BusinessException{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }
}
